import request from '@/utils/request'
const API_PREFIX = '/api/v1/auth'
import type { LoginForm, LoginVO, CaptchaResult } from './types.ts'
/**
 *  登录
 * @param params
 * @returns
 */
export const doLogin = (params: LoginForm) => {
    return request.post<LoginVO>(`${API_PREFIX}/login`, params)
}

/**
 * 退出登录
 * @returns
 */
export const doLogout = () => {
    return request.get(`${API_PREFIX}/logout`)
}

/**
 *  获取验证码
 * @returns
 */
export const getCaptcha = () => {
    return request.get<CaptchaResult>(`${API_PREFIX}/captcha`)
}
